﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Com.CMS263.DAO;
using Com.CMS263.PO;

namespace Com.CMS263.BLL
{
    public class QuestionBLL : BaseBLL<Question>
    {
        QuestionDAO dao = new QuestionDAO();
        public Question entity = new Question();
        public override Question GetModel()
        {
            return entity;
        }
        /// <summary>
        /// 按日期倒序分页查询提问
        /// </summary>
        /// <param name="page"></param>
        /// <param name="pagesize"></param>
        /// <returns></returns>
        public IList<Question> GetListByPage(int page, int pagesize, int state)
        {
            return dao.GetListByPage(page, pagesize,state);
        }
        /// <summary>
        /// 留言总条数
        /// </summary>
        /// <returns></returns>
        public int GetCount(int state)
        {
            return dao.GetCount(state);
        }
        /// <summary>
        /// 查询全部
        /// </summary>
        /// <returns></returns>
        public IList<Question> FindAll()
        {
            return dao.FindAll();
        }
        /// <summary>
        /// 查询我的提问
        /// </summary>
        /// <param name="CurrentIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="state"></param>
        /// <param name="userId"></param>
        /// <returns></returns>
        public IList<Question> GetListByPage(int page, int pageSize, int state, int type)
        {
            return dao.GetListByPage(page, pageSize, state, type);
        }
        public int GetCount(int state, int type)
        {
            return dao.GetCount(state, type);
        }
    }
}
